package day1204_2;

class WuDaLang extends  Thread{
    public void run() {
        for(int i=1;i<=10000;i++)
            System.out.println("做烧饼");
    }
}

class Customer extends  Thread{
    WuDaLang  wdl;
    public void run() {
        try {
            wdl.join();//等待wdl执行完毕才能执行Customer的run方法
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("吃烧饼");
    }
}
public class TDemo2 {
    public static void main(String[] args) {
        WuDaLang  wudl=new WuDaLang();
        Customer c1=new Customer();
        c1.wdl=wudl;
        wudl.start();
        c1.start();
    }
}
